package com.hsh.maoduo.pojo.dto;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import lombok.Data;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.util.Date;

/**
 * 出库
 *
 * @TableName outbound
 */

@Data
@Accessors(chain = true)
public class OutboundDTO implements Serializable {
    /**
     * 出库id
     */
    @TableId(type = IdType.AUTO)
    private Integer id;

    /**
     *
     */
    private String no;
    /**
     * 商品id
     */
    private Integer goodsId;
    /**
     *
     */
    private String goodsName;

    /**
     * 出库数量
     */
    private Integer num;
    /**
     * 规格（个/盒）
     */
    private Integer perBox;
    /**
     * 盒数
     */
    private BigDecimal boxNum;

    /**
     * 店铺id
     */
    private Integer shopId;

    /**
     *
     */
    private String shopName;

    /**
     * 备注
     */
    private String note;

    /**
     * 创建时间
     */
    private Date createTime;
    /**
     *核销状态
     */
    private Integer isVerified;
    public void init() {
        this.perBox = (this.perBox == null ? 1 : this.perBox);
        this.num = (this.num == null ? 0 : this.num);
        this.boxNum = BigDecimal.valueOf(this.num).divide(BigDecimal.valueOf(this.perBox),2, RoundingMode.HALF_UP);
    }
}